import axios from 'axios'

import type { AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios'

const http: AxiosInstance = axios.create({
  baseURL: "https://fc-mp-827be4c1-176f-4e1f-985a-621b4417eadf.next.bspapp.com/api"
})

http.interceptors.request.use((config: InternalAxiosRequestConfig): InternalAxiosRequestConfig => {
  config.headers['uni-id-token'] = localStorage.getItem('token')
  return config
})

http.interceptors.response.use((res: AxiosResponse): AxiosResponse => {
  return res
})


export const uploadInstance = axios.create({

  baseURL: "https://d33a5037-6c63-4e92-8bb1-30018ab701ea.bspapp.com/http"
})


export default http
